<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>动画</title>

    <style type="text/css">
        @keyframes mymove {
            /* 0% 与 from 等价 */
            0% {
                left: 0;
            }
            25% {
                left: 25%;
                background: purple;
            }
            50% {
                left: 50%;
              
                background: green;
                transform: scale(1.25);
            }
            75% {
                left: 25%;
                background: rgb(99, 242, 255);
            }
            /* 100% 与 to 等价 */
            100% {
                left: 0;
            }
        }
        
        .ball {
            position: relative;
            width: 100px;
            height: 100px;
            background: #dedede;
            border: 1px solid blue;
            border-radius: 50%;
            text-align: center;
            line-height: 100px;
            user-select: none;
            /* 根据 动画名称 确定 引用哪个动画 */
            animation-name: mymove;
            /* 确定动画播放时间 */
            animation-duration: 10s;
            /* 确定动画在什么时候播放 */
            animation-delay: 1s;
            /* 设置动画播放次数 */
            animation-iteration-count: infinite;
        }
    </style>
</head>

<body>

    <div class="ball"></div>

</body>

</html>